<?php

namespace App\Console\Commands;

use App\Services\ASRService;
use Illuminate\Console\Command;
use TencentCloud\Common\CommonClient;
use TencentCloud\Common\Exception\TencentCloudSDKException;
use TencentCloud\Common\Credential;

class QCloudRec extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'app:qcloud-rec';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Execute the console command.
     */
    public function handle()
    {
        $audioFile = "/images/e4Vk1BdVdPo1G8wgXogw9j1x5fUyBF.mp3";
        try {
            $text = ASRService::audioToText($audioFile);
            $this->info($text);
        } catch (Exception $e) {
            $this->error($e->getMessage());
        }
    }
}
